<template>
	<view class="approver-body" :style="{height:approverHeight+'px'}">	
			<view class="approver-list" v-for="(item,index) in ClassTeacher" @tap="Selectuser(item)">
				<view class="approver-list_1">
					<image class="image-list" :src="item.image" mode=""></image>
					<view class="l-1">
						<view class="">
							{{item.name}}
						</view>
						<view class="">
							{{item.role===1?'老师':'教务'}}
						</view>
					</view>
				</view>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				approverHeight: '',
				ClassTeacher: ''
			}
		},
		onReady() {
			let that = this;
			uni.getSystemInfo({ //调用uni-app接口获取屏幕高度
				success(res) { //成功回调函数
					that.approverHeight = res.windowHeight //windoHeight为窗口高度，主要使用的是这个
					console.log(that.shopHeight)
					console.log(res.windowHeight)
				}
			})

		},
		onLoad(option) {
			this.getClassTeacher(option.id)
		},
		methods: {
			Selectuser(item) {
				uni.$emit("handleFun",{title: item});
				uni.navigateBack(1)
			},
			getClassTeacher(id) {
				this.$api.getClassTeacher({
					scheduleId: id
				}).then((res) => {
					if (res.data.code == 200) {
						console.log(res.data.dataMap)
						this.ClassTeacher = res.data.dataMap
					}
				})
			}
		}
	}
</script>

<style scoped>
	.approver-body {
		background-color: #F8f8f8;
	}

	.image-list {
		width: 72rpx;
		height: 72rpx;
		border-radius: 50%;
	}
	.approver-list_1{
		display: flex;
		align-items: center;
	}
	.approver-list {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 690rpx;
		height: 100rpx;
		background-color: #FFFFFF;
		padding: 10rpx 30rpx 10rpx 30rpx;
		margin-bottom: 16rpx;
	}

	.l-1 {
		margin-left: 20rpx;
	}

	.l-1>view:nth-child(2) {
		color: #999999;
	}
</style>
